Integrating with Jenkins(Pipeline)
Jenkins is an open-source automation platform for building, deploying, and automating various projects. It can function as a basic CI server or be expanded into a comprehensive continuous delivery hub. Setting up and configuring Jenkins is straightforward through its web interface.
This document describes how to execute DevAssure tests within a Jenkins pipeline using the DevAssure Command Line Interface (CLI).
Requirements
- A valid DevAssure authentication token.
Creating a new Jenkins Pipeline
- Log into your Jenkins instance and navigate to the Dashboard Page.
- Click New Item on the left menu in the Dashboard page.
- Enter a name, select 'Pipeline' as the Project type and click on the 'Ok' button to create the Pipeline.
Configuring the Pipeline
- Scroll down to the Pipeline section and add the script below, for Linux
pipeline {
agent any
environment {
DEVASSURE_CLI_URL = 'https://devassures3bucket.s3.amazonaws.com/linux/cli/DevAssure.zip' // Update with your download URL
DEVASSURE_TOKEN = ' Replace with your actual token '
}
stages {
stage('Download DevAssureCLI (if needed)') { // Optional stage for downloading the CLI
when {
expression {
// Check if DevAssure CLI exists (adjust path based on your installation)
return !fileExists('/path/to/DevAssure')
}
}
steps {
sh '''
curl -L $DEVASSURE_CLI_URL -o DevAssure.zip
unzip DevAssure.zip
'''
}
}
stage('Run DevAssure Tests') {
steps {
script {
// Define variables
def sourcePath = '/Users/stark/DevAssure/Marvel' // Update with your actual source path
def targetPath = '/Users/stark/temp/' // Update with your target path
def suitePath = '/Users/stark/DevAssure/Marvel/test-suite/P0.suite.tspp' // Update with your test suite path
def jobName = 'p0_tests' // Update with your desired job name
def runProfilePath = '/Users/stark/DevAssure/Marvel/run-profile/chrome.profile.tspp' // Update with your run profile path
sh '''
./DA \
--auth-token $DEVASSURE_TOKEN \
--source ${sourcePath} \
--target ${$targetPath} \
run \
--suite ${suitePath} \
--total-nodes 1 \
--node-id 0 \
--branch beta \
--job-name ${jobName} \
--run-profile ${runProfilePath}
'''
}
}
}
}
}
info
We suggest you get help from your Ops team in configuring the Build Pipeline if you are trying it for the first time.
Running the job
- Once you've saved the job configuration, click "Build Now" on the left-hand panel.
- Upon job completion, the script execution details should be visible in the "Console Output" page.
- If the test execution and DevAssure CLI configuration were successful, you should see test results were submitted to your DevAssure instance.
- You can view the reults under the Reports section of your instance in the DevAssure web app.